package com.example.glide_pre_demo.widget;

import android.content.Context;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.TextView;

import com.example.glide_pre_demo.R;

/**
 * @author carlos
 * @date 2016/5/17
 */
public class FutureStudioView extends FrameLayout {
    ImageView iv;
    TextView tv;

    public FutureStudioView(Context context, AttributeSet attrs) {
        super(context, attrs);
        initialize(context);
    }

    public FutureStudioView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        initialize(context);
    }

    private void initialize(Context context) {
        inflate(context, R.layout.custom_view_futurestudio, this);
        iv = (ImageView) findViewById(R.id.iv_custom);
        tv = (TextView) findViewById(R.id.tv_custom);
    }

    public void setImage(Drawable drawable) {
        iv.setImageDrawable(drawable);
    }

    public void setText(String text) {
        tv.setText(text);
    }
}